package cn.hiapi.shopkeeper.entity.order;

import cn.hiapi.basic.entity.BasicEntity;
import cn.hiapi.basic.serializer.LongToStringSerializer;
import cn.hiapi.shopkeeper.enums.ActivityType;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author AdinZ
 * @date 2023/1/2 20:49
 */

@Entity
@Table(name = "hiapi_shopkeeper_activity_my_order")
@ApiModel(description = "卡包服务")
@Getter
@Setter
public class MyActivityOrder extends BasicEntity {


    @Id
    @GeneratedValue(generator = "snowflake")
    @GenericGenerator(name = "snowflake", strategy = "cn.hiapi.basic.id.SnowflakeId")
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;

    @ApiModelProperty("店铺id")
    private long shopId;
    @ApiModelProperty("买家id")
    private long buyerId;

    private long oid;

    @ApiModelProperty("活动类型")
    @Enumerated(EnumType.STRING)
    private ActivityType activityType;

    @ApiModelProperty("活动id")
    private long aid;

    @ApiModelProperty("卡包标题")
    private String title;

    private String thumb;

    @ApiModelProperty("购买价格")
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal price = BigDecimal.ZERO;

    @ApiModelProperty("购买价格")
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal costPrice = BigDecimal.ZERO;

    @ApiModelProperty("状态 1进行中,2已结束")
    private int status = 1;

    @ApiModelProperty("活动开始时间")
    private long startTime;
    @ApiModelProperty("活动结束时间")
    private long endTime;


    @ApiModelProperty("创建时间")
    private long created = System.currentTimeMillis();

    @ApiModelProperty("更新时间")
    private long updated = System.currentTimeMillis();


}
